import request from '@/utils/request'

// 查询列表
export function listContractorMatching(query) {
  return request({
    url: '/match-info/list',
    method: 'post',
    data: query
  })
}

// 查询详细
export function getContractorMatchingDetail(id) {
  return request({
    url: '/match-info/getById/' + id,
    method: 'get'
  })
}

// 获取 片区
export function getDept() {
  return request({
    url: '/auth/dept/treeselect',
    method: 'get'
  })
}

// 新增
export function addContractorMatchingDetail(data) {
  return request({
    url: '/match-info/add',
    method: 'post',
    data: data
  })
}

// 修改
export function updateContractorMatchingDetail(data) {
  return request({
    url: '/match-info/update',
    method: 'post',
    data: data
  })
}

// 获取所有的项目的预算编制列表
export function getProjectBudget(params) {
  return request({
    url: `/bpm/bpmDataList`,
    method: 'get',
    params: params
  })
}

// 获取预算金额
export function getTotalBudget(params) {
  return request({
    url: `/match-info/totalBudget`,
    method: 'post',
    data: params
  })
}

// 新增承建商 提交
export function submitAddSupplier(params) {
  return request({
    url: `/base-supplier/add`,
    method: 'post',
    data: params
  })
}

// 软删除
export function delContractorMatching(roleId) {
  if (!(roleId instanceof Array)){
    roleId = [roleId]
  }
  return request({
    url: '/match-info/delete',
    method: 'post',
    data: roleId,
  })
}

// 片区 下拉选
export function zoneOption(){
  return request({
    url: '/match-info/option',
    method: 'get'
  })
}
